<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>工程竣工验收 - 监督申请</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <style>
        body {
            height: auto;
        }

        .content {
            padding: 20px;
        }
        .layui-container {
            padding-top: 20px;
            width: auto;;
        }

        /*单元格备注样式*/
        .layui-table td.tdBz {
            text-align: left;
            padding-left: 0;
            border-left: none;
            color: #aaa;
        }

        .padNone .layui-form-select .layui-input {
            padding-right: 0;
        }

        .hide {
            display: none;
        }
        .layui-form-select .layui-input{
            padding-right: 0px;
        }
    </style>
</head>
<body>
<div class="layui-container">
    <form id="form" class="layui-form layui-form-pane" action="" lay-filter="formData">
        <input type="hidden" id="cptAcceptanceId" name="id" class="formData" value="">

        <!--验收领导小组-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">项目信息</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8 required">项目名称</td>
                            <td colspan="2">
                                <input type="hidden" id="prjName" name="prjName" class="formData"/>
                                <select id="prjId" name="prjId" lay-filter="prjChange" class="layui-input formData" autocomplete="off">
                                    <option></option>
                                </select>
                            </td>
                            <td class="th8 required">单位工程名称</td>
                            <td colspan="2">
                                <input name="unitPrjName" lay-verify="isEmpty" type="text" class="layui-input formData" placeholder="单位工程名称" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">验收日期</td>
                            <td colspan="2">
                                <input name="aptDate" id="aptDate" placeholder="验收日期" autocomplete="off" class="layui-input formData" lay-verify="required" readonly>
                            </td>
                            <td class="th8 required">验收地点</td>
                            <td colspan="2">
                                <input name="site" lay-verify="isEmpty" type="text" class="layui-input formData" placeholder="验收地点" autocomplete="off">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>



        <!--验收领导小组-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">验收领导小组</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">组长</td>
                            <td colspan="2">
                                <input name="leader" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="组长名称" autocomplete="off">
                            </td>
                            <td class="th8">副组长</td>
                            <td colspan="2">
                                <input name="deputyLeader" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="副组长名称" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">成员</td>
                            <td colspan="5">
                                <input name="members" type="text" lay-verify="isEmpty|uname" class="layui-input formData"
                                       placeholder="成员名称" autocomplete="off">
                            </td>
                        </tr>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>


        <!--各专业验收组-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">各专业验收组</h2>
                <div class="layui-colla-content layui-show">
                    <script type="text/html" id="toolbarOrg">
                        <div class="layui-btn-container">
                            <input type="button"class="layui-btn" lay-event="add" value="新建">
                        </div>
                    </script>
                    <script type="text/html" id="toolbarOrg2">
                        <div class="layui-btn-container">
                            <!--不能修改-->
                        </div>
                    </script>
                    <script type="text/html" id="barDemo">
                        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
                        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="delete">删除</a>
                    </script>
                    <script type="text/html" id="barDemo2">
                    <!--不能修改-->
                    </script>
                    <table class="layui-hide" id="dataList" lay-filter="dataList"></table>

                </div>
            </div>
        </div>


        <!--工程竣工验收监督通知书-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">工程竣工验收监督通知书</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList12" lay-filter="dataList12"></table>
                </div>
            </div>
        </div>


        <script type="text/html" id="toolbarOrg1">
            <div class="layui-btn-container">
                <input type="button"class="layui-btn" lay-event="add" value="上传文件">
            </div>
        </script>
        <script type="text/html" id="toolbarOrg11">
            <div class="layui-btn-container">
                <!--不能修改-->
            </div>
        </script>
        <script type="text/html" id="toolbarOrg12">
            <div class="layui-btn-container">
                <input type="button"class="layui-btn" lay-event="add" value="生成通知书">
            </div>
        </script>
        <script type="text/html" id="barDemo1">
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="delete1">删除</a>
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download1">下载</a>
        </script>
        <script type="text/html" id="barDemo11">
            <!--不能修改-->
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download1">下载</a>
        </script>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">施工许可证</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList2" lay-filter="dataList2"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">施工单位的工程竣工报告</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList3" lay-filter="dataList3"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">监理单位的工程质量评估报告</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList4" lay-filter="dataList4"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">勘察、设计单位的质量检查报告</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList5" lay-filter="dataList5"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">监理资料</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList6" lay-filter="dataList6"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">施工单位的技术档案和施工管理资料</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList7" lay-filter="dataList7"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">建筑材料、建筑构配件和设备的进场试验报告</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList8" lay-filter="dataList8"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">施工单位签署的工程质量保修书</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList9" lay-filter="dataList9"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">建设单位按合同约定支付工程款证明</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList10" lay-filter="dataList10"></table>
                </div>
            </div>
        </div>

        <!--质量文件与质量保证资料-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">住宅工程质量分户验收表</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-hide" id="dataList11" lay-filter="dataList11"></table>
                </div>
            </div>
        </div>
    </form>
</div>
<script src="/static/js/main.js"></script>
<script type="text/javascript">
    var $;
    layui.use(['jquery', 'element', 'form', 'laydate', 'configure', 'configureCom', 'selectFun', 'bluebird', 'replaceStr', 'jsDictFile', 'mapExtend'], function () {
        $ = layui.jquery;
        var element = layui.element;
        var form = layui.form;
        var configure = layui.configure;
        var table = layui.table;
        var configureCom = layui.configureCom;
        var laydate = layui.laydate;
        var selectFun = layui.selectFun;
        var sessionFun = layui.sessionFun;//存储session
        var listData = sessionFun.get(configure.COMPLETION_ROW_DATA);
        var token = sessionFun.get(configure.SESSION_TOKEN) ? sessionFun.get(configure.SESSION_TOKEN).token : '';

        //待办项页面加载详情时会有cptAcceptanceId
        var cptAcceptanceId = sessionFun.get('cptAcceptanceId');
        //用于操作中止施工申请附件
        var id = '';
        //申请状态, 用于过滤文件删除按钮
        var status = '';
        //项目ID 流程页面进来时初始化项目信息用
        var prjId='';
        //项目名称 流程页面进来时初始化项目信息用
        var prjName='';

        laydate.render({
            elem: '#aptDate',
            type: 'datetime'
        });

        //详情或修改页面
        if (listData) {
            form.val('formData', listData);
            id = listData.id;
            status = listData.status;
//            //驳回和同意状态 显示审配相关内容
//            if(listData.status==2 || listData.status==3){
//                $("#sp").css("display","");
//            }
        //待办项加载详情
        }else if(cptAcceptanceId){
            var res={};
            var data1 = $.extend({cptAcceptanceId:cptAcceptanceId}, {token: token});
            var index = top.layer.load(1, {shade: 0.01});
            $.ajax({
                url: configure.COMPLETION_DETAIL_INFO,
                type: 'get',
                cache: false,
                async:false,
                data: data1,
                dataType: 'json',
                success: function (data) {
                    top.layer.close(index);
                    res = data;
                },
                error: function (data) {
                    top.layer.close(index);
                }
            });
            if(res.data){
                prjId = res.data.prjId;
                prjName = res.data.prjName;
                id = res.data.id;
                status = res.data.status;
                form.val('formData', res.data);
            }else{
                res.data = { id: cptAcceptanceId};
            }
        //发起中止施工申请
        }else{
            id = guid();
            $("#cptAcceptanceId").val(id);
        };
        form.render();


        /**
         * 绑定项目选择 及 项目列表加载
         * */
        form.on('select(prjChange)', function(data) {
            var prjName = $(data.elem).find("option:selected").text(); //得到被选中的text
            $("#prjName").val(prjName);
        });

        if(listData || !status){
            //加载已分配项目列表
            $.ajax({
                type: "POST",
                url: configure.RPJ_ASSIGN_LIST_HTTP+'?token='+token,
                data: {},
                success: function (data) {
                    var code = data.code;
                    var msg = data.msg;
                    if (code == "0" || msg == "success") {
                        var records = data.page.records;
                        if(records && records.length>0){
                            //遍历下拉查询返回值，并拼接到下拉框内
                            $.each(records, function(idx, obj) {
                                $("#prjId").append('<option value="'+obj.prjId+'">'+obj.prjName+'</option>');
                            });
                            if (listData) {
                                $('#prjId').val(listData.prjId);
                            }
                            //重新渲染form表单  否则动态option不生效
                            form.render('select');
                        }
                    } else {
                        layer.msg(data.msg);
                    }
                    layer.closeAll('loading');
                }
            });
        }else if(cptAcceptanceId){
            $("#prjId").empty();
            $("#prjId").append('<option value="'+prjId+'">'+prjName+'</option>');
            $('#prjId').val(prjId);
            //重新渲染form表单  否则动态option不生效
            form.render('select');
        }


//        var prjId = sessionFun.get('prjId');
//        //var project = sessionFun.get( 'PRJ_PROJECT_ENTITY');
//        configureCom.getAjax(configure.PRJ_PROJECT_VIEW_API,{ prjId:prjId } ).then(function(res){
//            if(!res.data){
//                res.data = { prjId: prjId};
//            }
//            form.val('example', res.data);
//        })



//        configureCom.getAjax(configure.CPT_ACCEPTANCE_VIEW_API,{ prjId: prjId } ).then(function(res){
//            if(!res.data){
//                res.data = { prjId: prjId};
//            }
//            form.val('example', res.data);
//        })



        /**
         * 验收专业小组
         */
        var cols = [[
            {field: 'specialty', title: '专业名称'},
            {field: 'leader', title: '组长' },
            {field: 'members', title: '组员'},
            {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 320}
        ]];
        var cols2 = [[
            {field: 'specialty', title: '专业名称'},
            {field: 'leader', title: '组长' },
            {field: 'members', title: '组员'},
            {fixed: 'right', title: '操作', toolbar: '#barDemo2', width: 320}
        ]];
        if(!status || status==0){
            configureCom.tableRenderGet(configure.CPT_ACCEPTANCE_TEAM_LIST_API, {cptId: id}, cols, 'dataList', 10, '', 'toolbarOrg',false);
        }else{
            configureCom.tableRenderGet(configure.CPT_ACCEPTANCE_TEAM_LIST_API, {cptId: id}, cols2, 'dataList', 10, '', 'toolbarOrg2',false);
        }
        //头工具栏事件
        table.on('toolbar(dataList)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_LIST_DATA, null);
                    editItem('专业验收小组', configure.CPT_ACCEPTANCE_TEAM_EDIT_HTML, configure.CPT_ACCEPTANCE_TEAM_SAVE_API);
                    break;
            }
        });
        //查看详情字典详情
        function editItem(title, htmlUrl, srvUrl) {
            top.layer.open({
                type: 2,
                title: title,
                area: configureCom.Psize2,
                content: configureCom.nocache(htmlUrl),
                btn: ['保存'],
                yes: function (index, layero) {
                    var iframeWin = top.window.frames['layui-layer-iframe' + index]; //得到iframe页的窗口对
                    var data = iframeWin.getData();
                    //保存验收记录小组关联申请ID
                    data.cptId = id;
                    configureCom.postDataAjax(srvUrl, data).then(function (res) {
                        if (res.code == 0) {
                            top.layer.close(index);
                            top.layer.msg('保存成功！');
                        } else {
                            top.layer.alert('保存失败！');
                        }
                    });
                },
                end: function () {
                    configureCom.tableReloadById('dataList');
                }
            });
        }
        //每行操作
        table.on('tool(dataList)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete') {
                //删除各专业验收组
                $.ajax({
                    type: "DELETE",
                    url: configure.COMPLETION_TEAM_DELETE_API+'/'+data.id+'?token='+token,
                    data: {
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById('dataList');
                    }
                });
            }else if(obj.event === 'edit'){
                sessionFun.set(configure.SESSION_LIST_DATA, data);
                editItem('专业验收小组', configure.CPT_ACCEPTANCE_TEAM_EDIT_HTML, configure.CPT_ACCEPTANCE_TEAM_SAVE_API);
            }
        });



        /**
         * 附件列表
         */
        var table2 = {
            id:'dataList2',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_SGXKZ'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table2.url, table2.data, table2.cols, table2.id, 10, '', 'toolbarOrg1',table2.page);
        }else{
            table2.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table2.url, table2.data, table2.cols, table2.id, 10, '', 'toolbarOrg11',table2.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList2)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_SGXKZ'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table2.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList2)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table2.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });

        var table3 = {
            id:'dataList3',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_JGBG'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table3.url, table3.data, table3.cols, table3.id, 10, '', 'toolbarOrg1',table3.page);
        }else{
            table3.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table3.url, table3.data, table3.cols, table3.id, 10, '', 'toolbarOrg11',table3.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList3)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_JGBG'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table3.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList3)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table3.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table4 = {
            id:'dataList4',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_JLDSGCZLJDBG'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table4.url, table4.data, table4.cols, table4.id, 10, '', 'toolbarOrg1',table4.page);
        }else{
            table4.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table4.url, table4.data, table4.cols, table4.id, 10, '', 'toolbarOrg11',table4.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList4)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_JLDSGCZLJDBG'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table4.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList4)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table4.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table5 = {
            id:'dataList5',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_KCSJDWDZLJCBG'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table5.url, table5.data, table5.cols, table5.id, 10, '', 'toolbarOrg1',table5.page);
        }else{
            table5.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table5.url, table5.data, table5.cols, table5.id, 10, '', 'toolbarOrg11',table5.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList5)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_KCSJDWDZLJCBG'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table5.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList5)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table5.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table6 = {
            id:'dataList6',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_JLZL'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table6.url, table6.data, table6.cols, table6.id, 10, '', 'toolbarOrg1',table6.page);
        }else{
            table6.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table6.url, table6.data, table6.cols, table6.id, 10, '', 'toolbarOrg11',table6.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList6)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_JLZL'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table6.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList6)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table6.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table7 = {
            id:'dataList7',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_SGDWDJSDAHSGGLZL'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table7.url, table7.data, table7.cols, table7.id, 10, '', 'toolbarOrg1',table7.page);
        }else{
            table7.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table7.url, table7.data, table7.cols, table7.id, 10, '', 'toolbarOrg11',table7.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList7)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_SGDWDJSDAHSGGLZL'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table7.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList7)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table7.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table8 = {
            id:'dataList8',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_JZCLPJHSBJCSYBG'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table8.url, table8.data, table8.cols, table8.id, 10, '', 'toolbarOrg1',table8.page);
        }else{
            table8.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table8.url, table8.data, table8.cols, table8.id, 10, '', 'toolbarOrg11',table8.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList8)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_JZCLPJHSBJCSYBG'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table8.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList8)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table8.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table9 = {
            id:'dataList9',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_SGDWQSDGCZLBXS'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table9.url, table9.data, table9.cols, table9.id, 10, '', 'toolbarOrg1',table9.page);
        }else{
            table9.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table9.url, table9.data, table9.cols, table9.id, 10, '', 'toolbarOrg11',table9.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList9)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_SGDWQSDGCZLBXS'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table9.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList9)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table9.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table10 = {
            id:'dataList10',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_JSDWAHTYDZFGCKZM'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table10.url, table10.data, table10.cols, table10.id, 10, '', 'toolbarOrg1',table10.page);
        }else{
            table10.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table10.url, table10.data, table10.cols, table10.id, 10, '', 'toolbarOrg11',table10.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList10)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_JSDWAHTYDZFGCKZM'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table10.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList10)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table10.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });


        var table11 = {
            id:'dataList11',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_ZZGCZLFHYSB'
            },
            page:false
        }
        if(!status || status==0){
            configureCom.tableRenderGet(table11.url, table11.data, table11.cols, table11.id, 10, '', 'toolbarOrg1',table11.page);
        }else{
            table11.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table11.url, table11.data, table11.cols, table11.id, 10, '', 'toolbarOrg11',table11.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList11)', function (obj) {
            switch (obj.event) {
                case 'add':
                    sessionFun.set(configure.SESSION_UPLOAD_CONFIG,{
                        url:configure.COMMON_UPLOAD_API,
                        formData:{
                            businessId:id,
                            code:'CPT_ACCPTANCE_FILES_ZZGCZLFHYSB'
                        },
                        accept:{
                            title: '文件上传',
                            extensions: 'gif,jpg,jpeg,bmp,png,dwg,doc,docx,xls,xlsx,ppt,pptx,pdf',
                            mimeTypes: 'image/*,application/pdf' +
                            'application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,' +
                            'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,' +
                            'application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,'
                        }
                    });
                    top.layer.open({
                        type: 2,
                        title: '上传附件',
                        content: configure.COMMON_UPLOAD_HTML,
                        area: configureCom.Psize1,
                        cancel: function (index, layero) {
                            configureCom.tableReloadById(table11.id);
                        }
                    });
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList11)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table11.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });



        var table12 = {
            id:'dataList12',
            cols:[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 320}
            ]],
            url:configure.SYS_DOC_ATTS_API,
            data:{
                businessId:id,
                code:'CPT_ACCPTANCE_FILES_GCJGYSJDTZS_SIGN'
            },
            page:false
        }
        if(status==0){
            configureCom.tableRenderGet(table12.url, table12.data, table12.cols, table12.id, 10, '', 'toolbarOrg12',table12.page);
        }else{
            table12.cols=[[
                {field: 'name', title: '文件名称'},
                {fixed: 'right', title: '操作', toolbar: '#barDemo11', width: 320}
            ]];
            configureCom.tableRenderGet(table12.url, table12.data, table12.cols, table12.id, 10, '', 'toolbarOrg11',table12.page);
        }
        //头工具栏事件
        table.on('toolbar(dataList12)', function (obj) {
            switch (obj.event) {
                case 'add':
                    //TODO 后台根据模板生成pdf文件
                    var res1 = null;
                    var data1 = {id:id};
                    $.ajax({
                        url: '/api/cpt/acceptance/gcjgysjdtzsFile/create?token='+token,
                        type: 'post',
                        cache: false,
                        async:false,
                        contentType : 'application/json',
                        dataType : 'json',
                        data :JSON.stringify(data1),
                        success: function (data) {
                            res1 = data;
                            layer.closeAll('loading');
                        },
                        error: function (data) {
                            layer.closeAll('loading');
                            layer.msg(data.msg?data.msg:"操作失败");
                        }
                    });

                    //查询竣工验收详情, 并判断状态, 是否显示保存按钮
                    if(res1 && res1.code==0){
                        sessionFun.set(configure.SESSION_SIGN_DATA,{id:id, fileName:res1.data.fileName, attId:res1.data.attId});
                        //打开插件工具, 盖章上传
                        top.layer.open({
                            type: 2,
                            title: '上传附件',
                            content: 'pages/completion/sign/gcjgysjdtzsSign.html',
                            area: configureCom.Psize1,
                            cancel: function (index, layero) {
                                configureCom.tableReloadById(table12.id);
                            },
                            btn: ['保存签章'],
                            yes: function (index, layero) {
                                var iframeWin = top.window.frames['layui-layer-iframe' + index]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                                iframeWin.signSave().then(function (res) {
                                    if (res.code == 1) {
                                        top.layer.msg(res.msg);
                                        top.layer.close(index);
                                        configureCom.tableReloadById(table12.id);
                                    } else {
                                        top.layer.alert(res.msg);
                                    }
                                });
                            }
                        });
                    }else if(res1.code){
                        layer.msg(res1.msg?res1.msg:"操作失败.");
                        return;
                    }else{
                        layer.msg("操作失败!");
                        return;
                    }
                    break;
            }
        });
        //每行操作
        table.on('tool(dataList12)', function (obj) {
            var data = obj.data;
            if (obj.event === 'delete1') {
                //删除文件
                $.ajax({
                    type: "POST",
                    url: configure.COMMON_FILE_DELETE_API+'?token='+token,
                    data: {
                        "attIds" : data.id
                    },
                    success: function (data) {
                        var code = data.code;
                        var msg = data.msg;
                        if (code == "0" || msg == "success") {

                        } else {
                            layer.msg(data.msg);
                        }
                        layer.closeAll('loading');
                        //页面刷新
                        configureCom.tableReloadById(table11.id);
                    }
                });
            }else if(obj.event === 'download1'){
                window.open(configure.COMMON_FILE_DOWNLOAD_API+'/'+data.id+'?token='+token)
            }
        });







    });

    function getData() {
        return new Promise(function (res, rej) {
            var data = {};
            if (!window.formVerifyFun()) {
                //return false;
            }

            $('.formData').each(function (index, item) {
                var key = $(item).attr('name');
                data[key] = $(item).val();
            });
            res({result: data});
        });
    }

    function guid() {
        uid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
            var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
            return v.toString(16);
        });
        return uid.replace(/-/g,'');
    };

</script>
</body>
</html>
